package com.ruoyi.project.cms.knowledgemanagement.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.cms.knowledgemanagement.domain.KnowledgeBenchmarking;
import com.ruoyi.project.cms.knowledgemanagement.mapper.KnowledgeBenchmarkingMapper;
import com.ruoyi.project.cms.knowledgemanagement.service.IKnowledgeBenchmarkingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KnowledgeBenchmarkingServiceImpl implements IKnowledgeBenchmarkingService {

    @Autowired
    private KnowledgeBenchmarkingMapper knowledgeBenchmarkingMapper;

    @Override
    public List<KnowledgeBenchmarking> findMore(KnowledgeBenchmarking knowledgeBenchmarking) {
        return knowledgeBenchmarkingMapper.selectKnowledgeBenchmarking(knowledgeBenchmarking);
    }

    /**
     * 根据项目id删除
     * @param project_id
     * @return
     */
    @Override
    public Integer deleteKnowledgeId(Integer project_id) {
        return knowledgeBenchmarkingMapper.deleteKnowledgeId(project_id);
    }



    /**
     * 批量删除
     * @param
     * @return
     * @throws Exception
     */
    @Override
    public int deleteRoleByIds(String ids) {
        Long[] roleIds = Convert.toLongArray(ids);
        return knowledgeBenchmarkingMapper.deleteRoleByIds(roleIds);
    }



    @Override
    public Integer updateKnowledgeId(Integer project_id) {
        return knowledgeBenchmarkingMapper.updateKnowledgeId(project_id);
    }

    @Override
    public int changeStatus(KnowledgeBenchmarking knowledgeBenchmarking) {
        return knowledgeBenchmarkingMapper.changeStatus(knowledgeBenchmarking);
    }

    @Override
    public KnowledgeBenchmarking selectKnowledgeBenchmarkingById(Long project_id) {
        return knowledgeBenchmarkingMapper.selectKnowledgeBenchmarkingById(project_id);
    }


}
